package com.abc.scholarship.common.utils;

import com.abc.scholarship.domain.entity.User;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-07-08  15:19
 */
public class UserHolder {

    public static User getUser(){
        return (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }

    public static Long getUId(){
        return getUser().getId();
    }

}
